//
//  CLNavPointAnnotation.m
//  CarLifes
//
//  Created by yu on 2017/7/13.
//  Copyright © 2017年 jpas. All rights reserved.
//

#import "NavPointAnnotation.h"

@interface NavPointAnnotation ()

@property (nonatomic, strong) NSMutableArray<CLLocation *> *locationsArray;

@end

@implementation NavPointAnnotation


- (CLLocation *)latestLocation
{
    return [self.locationsArray lastObject];
}

- (void)addLocation:(CLLocation *)location
{
    if (location == nil)
    {
        return;
    }
    [self.locationsArray addObject:location];
}


- (NSMutableArray<CLLocation *> *)locationsArray
{
    if (!_locationsArray) {
        _locationsArray = [NSMutableArray array];
    }
    return _locationsArray;
}

@end
